<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>04_对象扩展</title>
</head>
<body>
<!--
1. Object.is(v1, v2)
  * 判断2个数据是否完全相等
2. Object.assign(target, source1, source2..)
  * 将源对象的属性复制到目标对象上
3. 直接操作 __proto__ 属性
  let obj2 = {};
  obj2.__proto__ = obj1;
-->

<script type="text/javascript">
    // Object.is(v1, v2)  转化为字符串的形式判断
    console.log(0==-0) //true
    console.log(NaN==NaN) //false

    console.log(Object.is(0,-0)) //true
    console.log(Object.is(NaN,-NaN)) //false

    // Object.assign
    let obj={}
    let obj1={username:'sds',age:23};
    let obj2={ses:'sss'}
    Object.assign(obj,obj1,obj2);
    console.log(obj)

    // 直接操作 __proto__ 属性
  let obj3={}
  let obj4={qian:2323}
  obj3.__proto__=obj4;
    console.log(obj3.qian);

</script>
</body>

</html>